@extends('layouts.app')

@section('title','首页')

@section('content')
    <div class="jumbotron bg-success text-white p-4 rounded shadow-sm">
        <h1>欢迎来到Laravel+Bootstrap中级实战项目！</h1>
        <p>Laravel是一款应用最广泛的PHP框架~</p>
        <p><a href="{{route('topics.index')}}" class="btn btn-outline-warning btn-lg" role="button">
                进入社区
            </a>
        </p>
    </div>
    <div class="row">
        @foreach($categories as $category)
            <div class="col-md-3 mt-4 d-flex justify-content-center">
                <div class="card shadow-sm" style="width: 18rem;">
                    <img src="{{url('fakers/home/avatar'.$category->id.'.png')}}" class="card-img-top"
                         alt="{{$category->name}}">
                    <div class="card-body">
                        <h5 class="card-title text-success">{{$category->name}}</h5>
                        <p class="card-text text-secondary">{{$category->description}}</p>
                        <a href="{{route('categories.show',$category->id)}}" class="btn btn-outline-primary">
                            <i class="fa-brands fa-golang h2 pt-2 px-4"></i>
                        </a>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
@stop
